package com.youlu.campus.admin.commission;

import com.youlu.campus.admin.annotation.RequestActivityAuth;
import com.youlu.campus.entity.commission.SharingCommissionInfo;
import com.youlu.campus.service.commission.ActivitySharingCommissionProfitService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class ActivitySharingCommissionProfitController {

    @Autowired
    private ActivitySharingCommissionProfitService activitySharingCommissionProfitService;

    @PutMapping("/activity/sharing-commission/{activityId}")
    public QResult saveSharingProfitConfig(@PathVariable String activityId,
                                           @RequestBody SharingCommissionInfo sharingCommissionInfo) {
        activitySharingCommissionProfitService.saveSharingProfitConfig(activityId, sharingCommissionInfo);
        return QResult.success(null);
    }

    @GetMapping("/activity/sharing-commission/info")
    public QResult getSharingProfitConfigByActivityId(String activityId) {
        return QResult.success(activitySharingCommissionProfitService.getSharingProfitConfigByActivityId(activityId));
    }

}
